package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementQosActionShapeMapper;
import com.ruoyi.net.domain.ElementQosActionShape;
import com.ruoyi.net.service.IElementQosActionShapeService;

/**
 * 网元-QOS配置-流行为-流量整形Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementQosActionShapeServiceImpl implements IElementQosActionShapeService 
{
    @Autowired
    private ElementQosActionShapeMapper elementQosActionShapeMapper;

    /**
     * 查询网元-QOS配置-流行为-流量整形
     * 
     * @param id 网元-QOS配置-流行为-流量整形主键
     * @return 网元-QOS配置-流行为-流量整形
     */
    @Override
    public ElementQosActionShape selectElementQosActionShapeById(String id)
    {
        return elementQosActionShapeMapper.selectElementQosActionShapeById(id);
    }

    /**
     * 查询网元-QOS配置-流行为-流量整形列表
     * 
     * @param elementQosActionShape 网元-QOS配置-流行为-流量整形
     * @return 网元-QOS配置-流行为-流量整形
     */
    @Override
    public List<ElementQosActionShape> selectElementQosActionShapeList(ElementQosActionShape elementQosActionShape)
    {
        return elementQosActionShapeMapper.selectElementQosActionShapeList(elementQosActionShape);
    }

    /**
     * 新增网元-QOS配置-流行为-流量整形
     * 
     * @param elementQosActionShape 网元-QOS配置-流行为-流量整形
     * @return 结果
     */
    @Override
    public int insertElementQosActionShape(ElementQosActionShape elementQosActionShape)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementQosActionShape.getId())) {
            elementQosActionShape.setId(uuid);
        }
        elementQosActionShape.setCreateBy(SecurityUtils.getUsername());
        elementQosActionShape.setCreateTime(DateUtils.getNowDate());
        elementQosActionShape.setUpdateBy(SecurityUtils.getUsername());
        elementQosActionShape.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionShapeMapper.insertElementQosActionShape(elementQosActionShape);
    }

    /**
     * 修改网元-QOS配置-流行为-流量整形
     * 
     * @param elementQosActionShape 网元-QOS配置-流行为-流量整形
     * @return 结果
     */
    @Override
    public int updateElementQosActionShape(ElementQosActionShape elementQosActionShape)
    {
        elementQosActionShape.setUpdateBy(SecurityUtils.getUsername());
        elementQosActionShape.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionShapeMapper.updateElementQosActionShape(elementQosActionShape);
    }

    /**
     * 批量删除网元-QOS配置-流行为-流量整形
     * 
     * @param ids 需要删除的网元-QOS配置-流行为-流量整形主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionShapeByIds(String[] ids)
    {
        return elementQosActionShapeMapper.deleteElementQosActionShapeByIds(ids);
    }

    /**
     * 删除网元-QOS配置-流行为-流量整形信息
     * 
     * @param id 网元-QOS配置-流行为-流量整形主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionShapeById(String id)
    {
        return elementQosActionShapeMapper.deleteElementQosActionShapeById(id);
    }
}
